<?php /*a:1:{s:81:"/Users/juyaobin/Desktop/Site/app/useradmin/view/Edit/EditProject/EditProject.html";i:1611847341;}*/ ?>
<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport"
		content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title>网站后台管理模版</title>
	<link rel="stylesheet" type="text/css" href="/public/static/admin/layui/css/layui.css" />
	<link rel="stylesheet" type="text/css" href="/public/static/admin/css/admin.css" />
	<meta name="referrer" content="no-referrer" /><!-- 头部403 -->
	<!-- 图片上传 -->
	<script src="/public/static/admin/imgupdate/jquery.min.js"></script>
	<script src="/public/static/admin/imgupdate/jQuery.upload.min.js"></script>
	<link rel="stylesheet" href="/public/static/admin/imgupdate/upload.css">
	<!-- 图片上传 -->
	<script src="/public/static/admin/js/layer/layer.js"></script>
	<style>
		body .layer-test {
			background: none;
			box-shadow: none;
		}

		/* 定制化 */
		html .layui-layer-demo {
			background-color: #eee;
		}

		.layui-layer-demo .layui-layer-title {
			border: none;
			background-color: #333;
			color: #fff;
		}
	</style>
</head>

<body>
	<div class="page-content-wrap">
		<div class="layui-tab" style="margin: 0;">
			<div class="layui-tab-content">
				<div class="layui-tab-item"></div>
				<div class="layui-tab-item layui-show">
					<div class="layui-form-item">
						<label class="layui-form-label">分卷名称：</label>
						<div class="layui-input-block">
							<input type="text" name="projectname" required lay-verify="required" value="<?php echo htmlentities($projectTitle); ?>"
								placeholder="请输入分卷名称：例如第一章/第一话/第一集" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">分卷编号： </label>
						<div class="layui-input-block">
							<input type="tel" value="<?php echo htmlentities($projectOrder); ?>" name="subsection" required lay-verify="required"
								placeholder="第一卷就是1 第二卷就是2" autocomplete="off" class="layui-input">
						</div>
					</div>
					<!--站点配置-->
					<div class="layui-tab-item layui-show">
						<form class="layui-form" style="width: 90%;padding-top: 20px;">
							<div class="layui-form-item">
								<label class="layui-form-label">服务选择：</label>
								<div class="layui-input-block">
									<input type="radio" name="serverHost" value="localhost" title="本服务器" checked="">
									<input type="radio" name="serverHost" value="sina" title="新浪">
									<input type="radio" name="serverHost" value="bilibili" title="哔哩哔哩">
								</div>
							</div>
						</form>
					</div>
					<div class="layui-form-item">
						<h1 style="text-align: center;">图像上传：</h1>
						<div class="case">
							<div class="upload" data-type="png,jpg,jpeg,gif"
								action='/<?php echo htmlentities($useradmin); ?>/ImagesUpdate?database_table_name=<?php echo htmlentities($database_table_name); ?>&time=<?php echo htmlentities($time); ?>&encryption_bookId=<?php echo htmlentities($hashHmac_bookId); ?>&encryption_projectId=<?php echo htmlentities($hashHmac_projectId); ?>&bookId=<?php echo htmlentities($bookId); ?>&projectId=<?php echo htmlentities($projectId); ?>&pictureCloudAcceleration='
								data-num='1000' id='img-list'>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="layui-form-item" style="padding-left: 10px;">
			<div class="layui-input-block">
				<button class="layui-btn layui-btn-normal button-save-changes" lay-submit
					lay-filter="formDemo">保存更改数据</button>
				<button type="reset" class="layui-btn layui-btn-primary button-refresh-page">刷新页面</button>
			</div>
		</div>
	</div>
	<script src="/public/static/admin/layui/layui.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		layui.use(['form', 'element'], function () { });
		$(function () {
			var index = layer.open({
				type: 1,
				title: false,
				closeBtn: 0,
				shadeClose: false,
				skin: 'layer-test',
				content: '<div><img width="150" src="https://i0.hdslb.com/bfs/album/7f85abf4f2c87b70589e4b5a0b1d8fb340c0f2d4.gif"> <h1 style="text-align:center;font-size:30px;color:rgb(255,255,255);">拼命加载中</h1></div>'
			});
			$.ajax({
				type: "post",
				url: "/<?php echo htmlentities($useradmin); ?>/getImagesList",
				data: {
					"time": "<?php echo htmlentities($time); ?>",
					"encryption_bookId": "<?php echo htmlentities($hashHmac_bookId); ?>",
					"encryption_projectId": "<?php echo htmlentities($hashHmac_projectId); ?>",
					"bookId": "<?php echo htmlentities($bookId); ?>",
					"projectId": "<?php echo htmlentities($projectId); ?>",
				},
				dataType: "json",
				success: function (response) {
					if (response.code == 200) {
						getImagesListData = response.data;
						getImagesListData.list.forEach(value => {
							initialdata[value.original_name] = {
								"filename": value.original_name, //图片名
								"imagesId": value.frame_id, //图片名
								"fileServer": value.image_server_host, //服务地址
								"fileUrl": value.image_server_host +
									getImagesListData.service + "/" + value.frame_id,
							}
						});
						console.log(initialdata);
						$("#img-list").upload(

							function (_this, data) {
								alert(data)
							}
						)
						layer.close(index);
					} else { //出现错误
						alert('出现错误' + response.msg);
					}

				}
			});
			$('button.button-save-changes').click(function (e) { //提交数据
				var index = layer.open({
					type: 1,
					title: false,
					closeBtn: 0,
					shadeClose: false,
					skin: 'layer-test',
					content: '<div><img width="150" src="https://i0.hdslb.com/bfs/album/7f85abf4f2c87b70589e4b5a0b1d8fb340c0f2d4.gif"> <h1 style="text-align:center;font-size:30px;color:rgb(255,255,255);">拼命加载中</h1></div>'
				});
				$.ajax({
					type: "post",
					url: "/<?php echo htmlentities($useradmin); ?>/SubmissionProjectData",
					data: {
						"time": "<?php echo htmlentities($time); ?>",
						"encryption_bookId": "<?php echo htmlentities($hashHmac_bookId); ?>",
						"encryption_projectId": "<?php echo htmlentities($hashHmac_projectId); ?>",
						"bookId": "<?php echo htmlentities($bookId); ?>",
						"projectId": "<?php echo htmlentities($projectId); ?>",
						"imageList": postData,
						"projectName": $('input[name="projectname"]').val(),
						"subsection": $('input[name="subsection"]').val(),
					},
					dataType: "json",
					success: function (response) {
						if (response.code == 200) {
							layer.close(index);
							if (response.data.isOrder) {
								layer.open({
									type: 0,
									skin: 'layui-layer-demo', //样式类名
									title: "操作成功",
									closeBtn: 0, //不显示关闭按钮
									anim: 2,
									maxWidth: '50%',
									maxHeight: '50%',
									shadeClose: false, //开启遮罩关闭
									content: '<div style="max-width:100%">' +
										'<li style="text-align:center;" class="layer-area">' +
										'<div style="text-align:center;">' +
										'<img  draggable="false" style="max-Width:70%;max-height:60%;" src="https://i0.hdslb.com/bfs/album/481b5ceef0d56aa329652b269f5a02f447503e7b.png">' +
										'<div style="text-align:center;">' +
										'<font>操作成功</font>' +
										'</div>' +
										'</div>' +
										'</li>' +
										'</div>',
									btn: ['确认',] //可以无限个按钮
									,
									btn1: function (index, layero) {
										layer.close(index);
									}
								});
							} else {
								layer.open({
									type: 0,
									skin: 'layui-layer-demo', //样式类名
									title: "发生意外错误",
									closeBtn: 0, //不显示关闭按钮
									anim: 2,
									maxWidth: '50%',
									maxHeight: '50%',
									area: ['25%', '60%'],
									shadeClose: false, //开启遮罩关闭
									content: '<div style="max-width:100%">' +
										'<li style="text-align:center;" class="layer-area">' +
										'<div style="text-align:center;">' +
										'<img  draggable="false" style="max-Width:70%;max-height:60%;" src="https://i0.hdslb.com/bfs/album/89f61ba7b2456dfd5af4bd92b485553274f73ad4.png">' +
										'<div style="text-align:center;">' +
										'<font>文件图片 及 标题 更新成功 但是 序列更新失败因为有重复的 或者序列不正确</font>' +
										'</div>' +
										'</div>' +
										'</li>' +
										'</div>',
									btn: ['确认',] //可以无限个按钮
									,
									btn1: function (index, layero) {
										window.location.reload();
									}
								});
							}
						} else {
							alert('出现错误' + response.msg);
						}
					}
				});
			});
			$('button.button-refresh-page').click(function (e) { //刷新页面
				location.reload()
			});
			/* initialdata["20.jpg"] = {
					"filename": "20.jpg",
					"fileUrl": "https://i0.hdslb.com/bfs/album/4fd2594d3da5c47b6dd45c146c38efa8f14047db.jpg",
					"fileServer": "https://i0.hdslb.com/",
				},
				initialdata["21.jpg"] = {
					"filename": "21.jpg",
					"fileUrl": "https://i0.hdslb.com/bfs/album/9ea4b089e861fde439774fa235738bce07bbd607.jpg",
					"fileServer": "https://i0.hdslb.com/",
				},
				initialdata["22.jpg"] = {
					"filename": "22.jpg",
					"fileUrl": "https://i0.hdslb.com/bfs/album/0464e6cb02f5977bfc1d87b9fa992edb827bca10.jpg",
					"fileServer": "https://i0.hdslb.com/",
				} */


		})
	</script>

</body>

</html>